package main

func uniquePaths(m int, n int) int {
	tab := make([][]int, m)
	for i := 0; i < m; i++ {
		tab[i] = make([]int, n)
	}
	tab[0][0] = 0
	for i := 0; i < m; i++ {
		for j := 0; j < n; j++ {
			if i == 0 {
				tab[i][j] = 1
			} else if j == 0 {
				tab[i][j] = 1
			} else {
				tab[i][j] = tab[i-1][j] + tab[i][j-1]
			}
		}
	}
	return tab[m-1][n-1]
}

func main() {
	println(uniquePaths(3, 3))
}
